package com.itheima.dubbo.mongodb.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.itheima.commons.pojo.mongo.Album;
import com.itheima.dubbo.interfaces.AlbumApi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;

/**
 * @author yaohu
 * @date 2021/12/7
 * @Version 1.0
 * @describe
 */
@Service
public class AlbumApiImpl implements AlbumApi {

    @Autowired
    private MongoTemplate mongoTemplate;

    @Override
    public void saveAlbum(Album album, Long userId) {
        mongoTemplate.save(album, "quanzi_album_" + userId);
    }
}
